"""
-------------------------------------------------
   File Name：     Runme
   Description :
   Author :       Jolg
   date：          2021/11/4
-------------------------------------------------
   Change Activity:
                   2021/11/4:
-------------------------------------------------
"""


from fastapi import FastAPI,Depends
import conf
from starlette.staticfiles import StaticFiles
from utils import auth_user
from utils.middle_regedit import register_exception,register_cors,register_middleware
from pear import menu
app = FastAPI(
    title=conf.config.TITLE,
    description=conf.config.DESCRIPTION,
    version=conf.config.VERSION,
    dependencies=[Depends(auth_user.Check_user)]
)


app.mount('/static', StaticFiles(directory='static'), name='static')

register_exception(app)  # 注册捕获异常信息
register_cors(app)  # 跨域设置
register_middleware(app)

app.include_router(auth_user.router,tags=["用户"],prefix="/user")

app.include_router(menu.router,tags=["菜单"],prefix="/menu")
